// ----------------------------------------------------------------------------
// math_unit_test.cpp
// ----------------------------------------------------------------------------
#include <fw/base/core/macros.h>
#if defined(FW_ENABLE_UNIT_TEST)
#include <fw/base/core/debugconsole.h>
#include <gtest/gtest.h>
#include <fw/base/math/vector4.h>
#include <fw/base/math/hlsl_intrinsic.h>

TEST(math, VectorMath)
{
    {
        float4 a(0, 0, 0, 1), b(1, 2, 3, 0);
        float4 c = a + b;
        float  cx = static_cast<float>(c.getX());
        float  cy = static_cast<float>(c.getY());
        float  cz = static_cast<float>(c.getZ());
        float  cw = static_cast<float>(c.getW());
        ASSERT_EQ(cx, 1.0f);
        ASSERT_EQ(cy, 2.0f);
        ASSERT_EQ(cz, 3.0f);
        ASSERT_EQ(cw, 1.0f);
    }
    
//	float3 i(0,-5,-5), n(0,1,0);
//	float3 r = fw::reflect(i, n);
//	
//	FW_PRINTF("reflect(i,n) = (%f, %f, %f)", (float)r.getX(), (float)r.getY(), (float)r.getZ());
//	
//	float eta = 1.0003f; // 水の屈折率.
//	r = fw::reflact(i, n, eta);
//	
//	FW_PRINTF("reflact(i,n) = (%f, %f, %f)", (float)r.getX(), (float)r.getY(), (float)r.getZ());
//	
//	float4 h(1.2f, 2.5f, 3.8f,-4.2f);
//	float4 h_frac = fw::frac(h);
//	FW_PRINTF("floor= (%f, %f, %f, %f)\n",
//			  (float)h_frac.getX(), (float)h_frac.getY(), (float)h_frac.getZ(), (float)h_frac.getW());
}

#endif // FW_ENABLE_UNIT_TEST

void MATH_UNIT_TEST()
{
}
